#ifndef _GEOMETRY_H
#define _GEOMETRY_H

#include "GlobalDefines.h"
class Geometry
{
public:
	Geometry(){};
	virtual ~Geometry(){};
	virtual void ReadGeometry(char* GeoName,emx::Real3D Shift) = 0;
protected:
	std::ifstream fin;
};

class TriangleMesh:public Geometry
{
public:
	TriangleMesh(emx::MediumType medium):Medium(medium){};
	virtual ~TriangleMesh(){};
	void ReadGeometry(char* GeoName,emx::Real3D Shift);
	const int GetPatchNum() const{return Patch_Num;}
	const int GetEdgeNum() const{return Edge_Num;}
	const emx::node* GetNode(const int Idx) const{return Node(Idx);}
	const emx::edge* GetEdge(const int Idx) const{return Edge(Idx);}
	const emx::facet* GetPatch(const int Idx) const{return Patch(Idx);}
private:
	bool ReadNodes(emx::Real3D Shift);
	bool ReadPatchs();
	bool ReadEdges();
private:
	emx::MediumType Medium;
	int Node_Num, Patch_Num, Edge_Num;
	blitz::Array<emx::node*, 1> Node;			
	blitz::Array<emx::edge*, 1> Edge;
	blitz::Array<emx::facet*, 1> Patch;
};

#endif
